<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="st" uri="http://www.springframework.org/tags"%>

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>扑通扑通</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%-- <c:set var="ctx" value="${pageContext.request.contextPath}" /> --%>
<c:set var="ctx" value="" />
<link rel="stylesheet"
	href="${ctx}/static/resource/css/theme.css?version=0.1">
<script src="${ctx}/static/resource/js/jquery-2.2.4.min.js"></script>
<script>
	$(function() {
		$("article").eq(0).show();
		$("menu li").click(function() {
			$(this).addClass('active').siblings().removeClass('active');
			var e = $(this).index();
			$("article").eq(e).show().siblings("article").hide();
		})
		addButtonListener();

	});

	function addButtonListener() {
		addTopListener('huoguo');

		addRouListener('rou_feiniu');
		addRouListener('rou_feiyang');
		addRouListener('rou_huiyupian');
		addRouListener('rou_daxia');
		addRouListener('rou_wucanrou');

		addYinliaoListener('yinliao_kele');
		addYinliaoListener('yinliao_xuebi');
		addYinliaoListener('yinliao_pijiu');
		addYinliaoListener('yinliao_shui');

		addSubListener('guodi');
		addSubListener('rou');
		addSubListener('zhushi');
		addSubListener('xiaoliao');

		addSubmitListener();
	}

	function addSubmitListener() {
		$("#submitbtn").click(function() {
			var isvalid = isInputValid();
		 
			if (isvalid == "1") {
				console.log("formsubmit...");
				submitOrderDishes();

			} else {
				return false;
			}
		});
	}
	function submitOrderDishes() {
		console.log("enter submitOrderDishes")
		var dish = {};
		var huoguolist = [];
		var roulist = [];
		var yinliaolist = [];
		$("#dishmunu > li")
				.each(function() {
							var subtext = $(this).find("a").text();
							var subitem = $(this).attr("id");
                           console.log(subitem+'----'+subtext);
							if (subitem.indexOf("huoguo") >= 0) {
								var price = $("#" + subitem + "_price").text();
								var noofbuy = $("#" + subitem + "_no").text();
								var huoguo = {};
								var huoguo_guodi = [];
								if (Number(noofbuy) > 0) {
									huoguo.name = subtext;
									huoguo.no = noofbuy;
									huoguo.price = price;

									$("h3[id^=" + subitem + "_guodi_]").each(function() {
														var huoguo_guodi_name = $(this).text();
														var huoguo_guodi_id = $(this).attr("id");
														var huoguo_guodi_no = $("#"+ huoguo_guodi_id+ "_no").text();
														var guodi = {};
														if (Number(huoguo_guodi_no) > 0) {
															guodi.name = huoguo_guodi_name;
															guodi.id = huoguo_guodi_id;
															guodi.no = huoguo_guodi_no;
															huoguo_guodi.push(guodi);
														}
														//alert(JSON.stringify(huoguo_guodi));
													});

									var huoguo_rou = [];
									$("h3[id^=" + subitem + "_rou_]").each(function() {
														var huoguo_rou_name = $(this).text();
														var huoguo_rou_id = $(this).attr("id");
														var huoguo_rou_no = $("#"+ huoguo_rou_id+ "_no").text();
														var rou = {};
														if (Number(huoguo_rou_no) > 0) {
															rou.name = huoguo_rou_name;
															rou.id = huoguo_rou_id;
															rou.no = huoguo_rou_no;
															huoguo_rou.push(rou);
														}
													});

									var huoguo_xiaoliao = [];
									$("h3[id^=" + subitem + "_xiaoliao_]").each(function() {
														var huoguo_xiaoliao_name = $(this).text();
														var huoguo_xiaoliao_id = $(this).attr("id");
														var huoguo_xiaoliao_no = $("#"+ huoguo_xiaoliao_id+ "_no").text();
														var xiaoliao = {};
														if (Number(huoguo_xiaoliao_no) > 0) {
															xiaoliao.name = huoguo_xiaoliao_name;
															xiaoliao.id = huoguo_xiaoliao_id;
															xiaoliao.no = huoguo_xiaoliao_no;
															huoguo_xiaoliao.push(xiaoliao);
														}
													});

									huoguo.guodi = huoguo_guodi;
									huoguo.rou = huoguo_rou;
									huoguo.xiaoliao = huoguo_xiaoliao;

									huoguolist.push(huoguo);

								}
							}
							if (subitem.indexOf("rou")>=0) {
								//var rou = [];
								$("h3[id^=rou]").each(function() {
											var routext = $(this).text();
											var rouid = $(this).attr("id");
											var rouno = $("#" + rouid + "_no").text();
											var rouprice = $("#" + rouid + "_price").text();
											console.log(routext+"  "+rouid+" "+rouno+" "+rouprice);
											 
											if (Number(rouno) > 0) {
												var subrou = {};
												subrou.name = routext;
												subrou.no = rouno;
												subrou.price = rouprice;
												roulist.push(subrou);
											}
											//alert(routext+"--"+rouprice+"--"+rouno);
										});
								/* 	if (rou.length > 0) {
										roulist.push(rou);
									} */

							}
							if (subitem.indexOf("yinliao")>=0) {
								//var yinliao = [];
								$("h3[id^=yinliao]").each(function() {
													var yinliaotext = $(this).text();
													var yinliaoid = $(this).attr("id");
													var yinliaono = $("#" + yinliaoid+ "_no").text();
													var yinliaoprice = $("#" + yinliaoid+ "_price").text();

													if (Number(yinliaono) > 0) {
														var subyinliao = {};
														subyinliao.name = yinliaotext;
														subyinliao.no = yinliaono;
														subyinliao.price = yinliaoprice;
														yinliaolist.push(subyinliao);
													}
													//alert(routext+"--"+rouprice+"--"+rouno);
												})
							/* 	if (yinliao.length > 0) {
									yinliaolist.push(yinliao);
								} */

							}
						});
		//  alert(JSON.stringify(dishlist));
		dish.huoguolist = huoguolist;
		dish.roulist = roulist;
		dish.yinliaolist = yinliaolist;

		$("#fdishlist").attr("value", JSON.stringify(dish));
		console.log(JSON.stringify(dish));
		$("#submitform").submit();
	}
	function isInputValid() {
		try {
			$("#dishmunu > li").each(function() {
								var subtext = $(this).find("a").text();
								var subitem = $(this).attr("id");
								if (subitem.indexOf("houguo") == 0) {
									var isguodipassed = validateItem(subitem,subtext, "guodi");
									if (isguodipassed != "1") {
										throw "valid failed";
									}

									var isroupassed = validateItem(subitem,subtext, "rou");
									if (isroupassed != 1) {
										throw "valid failed";
									}

									var iszhushipassed = validateItem(subitem,subtext, "zhushi");
									if (iszhushipassed != 1) {
										throw "valid failed";
									}

									var isxiaoliaopassed = validateItem(subitem,subtext, "xiaoliao");
									if (isxiaoliaopassed != 1) {
										throw "valid failed";
									}
								}
								
								

								if (subitem.indexOf("rou") == 0) {

								}
								if (subitem.indexOf("yinliao") == 0) {
									var yinliaono = 0;
									$("span[id^=yinliao_]").each(function() {
										var yinliaoid = $(this).attr("id");
										if (yinliaoid.indexOf("_no") > 0) {
											var selectNo = $(this).text();
											yinliaono += Number(selectNo);
										}
									});
									if (Number(yinliaono) > 10) {
										alert("饮料不能超过10份");
										throw "valid failed";
									}

								}

							});

			var totalPrice = $("#totalprice").text();
			if (Number(totalPrice) < 78) {
				alert("点餐少于78元不予配送");
				throw "valid failed";
			}
		} catch (e) {
			return false;
		}

		return "1";
	}
	function validateItem(subitem, subtext, item) {
		if (subitem.indexOf("huoguo") == 0) {
			var guodiid = subitem + "_" + item;
			var guodinoid = subitem + "_no";

			var guodino = $("#" + guodinoid).text();
			var subtotalno = 0;
			var itemtext = "";
			$("span[id^=" + guodiid + "]").each(function() {
				var subguodiid = $(this).attr("id");

				if (subguodiid != guodiid) {
					var subguodino = $(this).text();
					subtotalno = subtotalno + Number(subguodino);
				}
			});

			if (item == "guodi") {
				itemtext = "锅底";
			}
			if (item == "rou") {
				itemtext = "肉";
			}
			if (item == "xiaoliao") {
				itemtext = "小料";
			}
			if (item == "zhushi") {
				itemtext = "主食";
			}
			if (Number(subtotalno) != Number(guodino)) {
				//alert(subtotalno + "----" + guodino + '---'+ (Number(subtotalno) < Number(guodino)));
				alert(subtext + itemtext + "数量不正确");
				return false;
			}

		}
		return 1;
	}
	function addRouListener(name) {
		$("#" + name + "_add").click(function() {
			var price = getPrice(name);
			//refresh no of buy
			var no_of_buy = refreshNoOfBuy(name, "add");
			//总价
			refreshTotalPrice(price, "add");

		});

		$("#" + name + "_less").click(function() {
			var price = getPrice(name);
			//refresh no of buy
			var no_of_buy = refreshNoOfBuy(name, "less");
			//总价
			refreshTotalPrice(price, "less");

		});

	}
	function addYinliaoListener(name) {
		$("#" + name + "_add").click(function() {
			var price = getPrice(name);
			//refresh no of buy
			var no_of_buy = refreshNoOfBuy(name, "add");
			//总价
			refreshTotalPrice(price, "add");

		});

		$("#" + name + "_less").click(function() {
			var price = getPrice(name);
			//refresh no of buy
			var no_of_buy = refreshNoOfBuy(name, "less");
			//总价
			refreshTotalPrice(price, "less");

		});
	}

	function addTopListener(top) {
		$("." + top + "_add").click(function() {
			var id = $(this).attr("id");
			var prefix = id.substring(0, id.lastIndexOf("_"));
			//refresh no of buy
			var no_of_buy = refreshNoOfBuy(prefix, "add");
			var price = getPrice(prefix);
			//总价
			refreshTotalPrice(price, "add");
			//配料
			refreshNoOfPeiLiao(prefix);

		});
		$("." + top + "_less").click(function() {
			var id = $(this).attr("id");
			var prefix = id.substring(0, id.lastIndexOf("_"));
			if (isZero(prefix)) {
				return false;
			}
			var no_of_buy = refreshNoOfBuy(prefix, "less");
			var price = getPrice(prefix);
			refreshTotalPrice(price, "less");
			refreshNoOfPeiLiao(prefix);
		});

	}

	function addSubListener(subname) {
		$(".huoguo_" + subname + "_add").click(function() {

			var id = $(this).attr("id");

			var subprefix = id.substring(0, id.lastIndexOf("_"));
			var prefix = id.substring(0, subprefix.lastIndexOf("_"));

			var totalNum = getCurrentByNo(prefix);
			var currentno = getCurrentByNo(subprefix);
			var currentTotalNumber = 0;

			$(".huoguo_" + subname + "_sub").each(function() {

				var singleno = $(this).text();
				var singleid = $(this).attr("id");
				if (singleid.indexOf(prefix) >= 0) {
					currentTotalNumber = currentTotalNumber + Number(singleno);
				}

				//alert(singleno);

			});

			if (Number(currentTotalNumber) < Number(totalNum)) {
				currentno = Number(currentno) + 1;
				$("#" + subprefix + "_no").text(currentno);
			}
			//huoguo_danren_shoushen_guodi_qingtang
		});

		$(".huoguo_" + subname + "_less").click(function() {
			var id = $(this).attr("id");
			var subprefix = id.substring(0, id.lastIndexOf("_"));
			var prefix = id.substring(0, subprefix.lastIndexOf("_"));
			var currentno = getCurrentByNo(subprefix);
			if (Number(currentno) > 0) {
				currentno = Number(currentno) - 1;
				$("#" + subprefix + "_no").text(currentno);
			}
		});
	}

	function refreshNoOfPeiLiao(prefix) {
		var no = getCurrentByNo(prefix);
		$("#" + prefix + "_guodi_no").text(no);
		$("#" + prefix + "_shucai_no").text(no);
		$("#" + prefix + "_rou_no").text(no);
		$("#" + prefix + "_zhushi_no").text(no);
		$("#" + prefix + "_xiaoliao_no").text(no);
		$("#" + prefix + "_shucai_sub_no").text(no);

	}
	function isZero(prefix) {

		var no = getCurrentByNo(prefix);
		if (no == "0") {
			return true;
		}
		return false;
	}
	function getCurrentByNo(prefix) {
		var no_of_buy = prefix + "_no";
		var no = $("#" + no_of_buy).text();
		return no;
	}
	function refreshTotalPrice(price, addorless) {
		var totalno = $("#totalno").text();
		var totalprice = $("#totalprice").text();

		if (addorless == "add") {
			totalprice = Number(totalprice) + Number(price);
			totalno = Number(totalno) + 1;
		}
		if (addorless == "less") {
			if (totalprice != "0") {
				totalprice = Number(totalprice) - Number(price);
				totalno = Number(totalno) - 1;
			}

		}
		$("#totalno").text(totalno);
		$("#totalprice").text(totalprice);

	}

	function getPrice(prefix) {
		var price = $("#" + prefix + "_price").text();
		return price;

	}
	/***
	 *  
	 **/
	function refreshNoOfBuy(prefix, addorless) {
		//refresh no of buy
		var no_of_buy = prefix + "_no";
		var no = $("#" + no_of_buy).text();
		if (addorless == "add") {
			no = Number(no) + 1;
		}
		if (addorless == "less") {
			if (no != "0") {
				no = Number(no) - 1;
			}
		}

		$("#" + no_of_buy).text(no);
		return no;
	}
</script>
</head>
<body>
	<span id="top" style="display: block; height: 1px;"></span>
	<div class="wrapper">
		<menu>
			<ul id="dishmunu">
				<li id="huoguo_danren_shoushen" class="active"><a href="#top">瘦身美体</a></li>
				<li id="huoguo_danren_fanqie"><a href="#top">美容番茄</a></li>
				<li id="huoguo_danren_juntang"><a href="#top">滋补菌汤</a></li>
				<li id="rou"><a href="#top">肉</a></li>
				<li id="yinliao"><a href="#top">饮料</a></li>
			</ul>

		</menu>
		<span class="s"> <img
			src="${ctx}/static/resource/img/nav-si.svg" alt=""></span>

		<article>
		<h1>
			瘦身美体套餐 <span>¥<b id="huoguo_danren_shoushen_price">78</b>/套
			</span>
			<div class="number">
				<button class="huoguo_less" hidefocus="hidefocus"
					id="huoguo_danren_shoushen_less">
					<img src="${ctx}/static/resource/img/less.svg" alt="">
				</button>
				<span id="huoguo_danren_shoushen_no">0</span>
				<button class="huoguo_add" id="huoguo_danren_shoushen_add">
					<img src="${ctx}/static/resource/img/add.svg" alt="">
				</button>
			</div>
		</h1>
		<h2>
			锅底 <span>必选 <b id="huoguo_danren_shoushen_guodi_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_guodi_qingtang">清汤锅底</h3>
				<div class="number">
					<button id="huoguo_danren_shoushen_guodi_qingtang_less"
						class="huoguo_guodi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_guodi_qingtang_no"
						class="huoguo_guodi_sub">0</span>
					<button id="huoguo_danren_shoushen_guodi_qingtang_add"
						class="huoguo_guodi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img2.jpg"
				alt="">
				<h3>麻辣锅底</h3>
				<div class="number">
					<button id="huoguo_danren_shoushen_guodi_mala_less"
						class="huoguo_guodi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_guodi_mala_no"
						class="huoguo_guodi_sub">0</span>
					<button id="huoguo_danren_shoushen_guodi_mala_add"
						class="huoguo_guodi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
		</ul>
		<h2>
			蔬菜 <span>必选 <b id="huoguo_danren_shoushen_shucai_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img3.jpg"
				alt="">
				<h3>时蔬大拼</h3>
				<div class="number">
					<span id="huoguo_danren_shoushen_shucai_sub_no">0</span>
				</div></li>
		</ul>
		<h2>
			肉类 <span>可选 <b id="huoguo_danren_shoushen_rou_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img4.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_rou_huiyupian">鮰鱼片</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_rou_huiyupian_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_rou_huiyupian_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_shoushen_rou_huiyupian_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img5.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_rou_daxia">大虾</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_rou_xia_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_rou_xia_no" class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_shoushen_rou_xia_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			主食 <span>可选 <b id="huoguo_danren_shoushen_zhushi_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img6.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_zhushi_huoguomian">火锅面</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_zhushi_huoguomian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_zhushi_huoguomian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_shoushen_zhushi_huoguomian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img7.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_zhushi_tudoufen">土豆粉</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_zhushi_tudoufen_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_zhushi_tudoufen_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_shoushen_zhushi_tudoufen_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img21.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_zhushi_shanggudunmian">上古炖面</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_zhushi_shanggudunmian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_zhushi_shanggudunmian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_shoushen_zhushi_shanggudunmian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			小料 <span>可选 <b id="huoguo_danren_shoushen_xiaoliao_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img9.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_xiaoliao_xiangyou">香油</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_xiaoliao_xiangyou_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_xiaoliao_xiangyou_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_shoushen_xiaoliao_xiangyou_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img10.jpg"
				alt="">
				<h3 id="huoguo_danren_shoushen_xiaoliao_majiang">麻酱</h3>

				<div class="number">
					<button id="huoguo_danren_shoushen_xiaoliao_majiang_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_shoushen_xiaoliao_majiang_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_shoushen_xiaoliao_majiang_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		</article>
		<article>
		<h1>
			美容番茄套餐 <span>¥<b id="huoguo_danren_fanqie_price">78</b>/套
			</span>
			<div class="number">
				<button class="huoguo_less" id="huoguo_danren_fanqie_less">
					<img src="${ctx}/static/resource/img/less.svg" alt="">
				</button>
				<span id="huoguo_danren_fanqie_no">0</span>
				<button class="huoguo_add" id="huoguo_danren_fanqie_add">
					<img src="${ctx}/static/resource/img/add.svg" alt="">
				</button>
			</div>
		</h1>
		<h2>
			锅底 <span>必选 <b id="huoguo_danren_fanqie_guodi_no">0 </b>份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img31.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_guodi_fanqie">番茄锅底</h3>
				<div class="number">
					<button id="huoguo_danren_fanqie_guodi_fanqie_less"
						class="huoguo_guodi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_guodi_fanqie_no"
						class="huoguo_guodi_sub">0</span>
					<button id="huoguo_danren_fanqie_guodi_fanqie_add"
						class="huoguo_guodi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			蔬菜 <span>必选 <b id="huoguo_danren_fanqie_shucai_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img3.jpg"
				alt="">
				<h3>时蔬大拼</h3>
				<div class="number">
					<span id="huoguo_danren_fanqie_shucai_sub_no">0</span>
				</div></li>
		</ul>
		<h2>
			肉类 <span>可选<b id="huoguo_danren_fanqie_rou_no"> 0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img22.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_rou_feiniu">肥牛</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_rou_feiniu_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_rou_feiniu_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_fanqie_rou_feiniu_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img23.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_rou_feiyang">肥羊</h3>
				<div class="number">
					<button id="huoguo_danren_fanqie_rou_feiyang_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_rou_feiyang_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_fanqie_rou_feiyang_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img4.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_rou_huiyupian">鮰鱼片</h3>

				<div class="number">

					<button id="huoguo_danren_fanqie_rou_huiyupian_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_rou_huiyupian_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_fanqie_rou_huiyupian_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img5.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_rou_daxia">大虾</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_rou_daxia_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_rou_daxia_no" class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_fanqie_rou_daxia_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img24.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_rou_wucanrou">午餐肉</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_rou_wucanrou_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_rou_wucanrou_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_fanqie_rou_wucanrou_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			主食 <span>可选 <b id="huoguo_danren_fanqie_zhushi_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img6.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_zhushi_guoguomian">火锅面</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_zhushi_huoguomian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_zhushi_huoguomian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_fanqie_zhushi_huoguomian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img7.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_zhushi_tudoufen">土豆粉</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_zhushi_tudoufen_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_zhushi_tudoufen_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_fanqie_zhushi_tudoufen_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img21.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_zhushi_shanggudunmian">上古炖面</h3>
				<div class="number">
					<button id="huoguo_danren_fanqie_zhushi_shanggudunmian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_zhushi_shanggudunmian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_fanqie_zhushi_shanggudunmian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
		</ul>
		<h2>
			小料<span> 可选 <b id="huoguo_danren_fanqie_xiaoliao_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img9.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_xiaoliao_xiangyou">香油</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_xiaoliao_xiangyou_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_xiaoliao_xiangyou_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_fanqie_xiaoliao_xiangyou_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img10.jpg"
				alt="">
				<h3 id="huoguo_danren_fanqie_xiaoliao_majiang">麻酱</h3>

				<div class="number">
					<button id="huoguo_danren_fanqie_xiaoliao_majiang_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_fanqie_xiaoliao_majiang_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_fanqie_xiaoliao_majiang_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		</article>
		<article>
		<h1>
			滋补菌汤套餐 <span>¥<b id="huoguo_danren_juntang_price">78</b>/套
			</span>
			<div class="number">
				<button class="huoguo_less" id="huoguo_danren_juntang_less">
					<img src="${ctx}/static/resource/img/less.svg" alt="">
				</button>
				<span id="huoguo_danren_juntang_no">0</span>
				<button class="huoguo_add" id="huoguo_danren_juntang_add">
					<img src="${ctx}/static/resource/img/add.svg" alt="">
				</button>
			</div>
		</h1>
		<h2>
			锅底 <span>必选 <b id="huoguo_danren_juntang_guodi_no">0</b>份
			</span>
			<ul>
		</h2>
		<li><img class="img" src="${ctx}/static/resource/img/img41.jpg"
			alt="">
			<h3 id="huoguo_danren_juntang_guodi_juntang">滋补菌汤</h3>
			<div class="number">
				<button id="huoguo_danren_juntang_guodi_juntang_less"
					class="huoguo_guodi_less">
					<img src="${ctx}/static/resource/img/less.svg" alt="">
				</button>
				<span id="huoguo_danren_juntang_guodi_juntang_no"
					class="huoguo_guodi_sub">0</span>
				<button id="huoguo_danren_juntang_guodi_juntang_add"
					class="huoguo_guodi_add">
					<img src="${ctx}/static/resource/img/add.svg" alt="">
				</button>
			</div></li>
		</ul>
		<h2>
			蔬菜 <span>必选 <b id="huoguo_danren_juntang_shucai_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img3.jpg"
				alt="">
				<h3>时蔬大拼</h3>
				<div class="number">
					<span id="huoguo_danren_juntang_shucai_sub_no">0</span>
				</div></li>
		</ul>
		<h2>
			肉类 <span>可选<b id="huoguo_danren_juntang_rou_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img22.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_rou_feiniu">肥牛</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_rou_feiniu_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_rou_feiniu_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_juntang_rou_feiniu_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img23.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_rou_feiyang">肥羊</h3>
				<div class="number">
					<button id="huoguo_danren_juntang_rou_feiyang_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_rou_feiyang_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_juntang_rou_feiyang_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img4.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_rou_huiyupian">鮰鱼片</h3>

				<div class="number">

					<button id="huoguo_danren_juntang_rou_huiyupian_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_rou_huiyupian_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_juntang_rou_huiyupian_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img5.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_rou_daxia">大虾</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_rou_daxia_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_rou_daxia_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_juntang_rou_daxia_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img24.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_rou_wucanrou">午餐肉</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_rou_wucanrou_less"
						class="huoguo_rou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_rou_wucanrou_no"
						class="huoguo_rou_sub">0</span>
					<button id="huoguo_danren_juntang_rou_wucanrou_add"
						class="huoguo_rou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			主食 <span>可选 <b id="huoguo_danren_juntang_zhushi_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img6.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_zhushi_huoguomian">火锅面</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_zhushi_huoguomian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_zhushi_huoguomian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_juntang_zhushi_huoguomian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img7.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_zhushi_tudoufen">土豆粉</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_zhushi_tudoufen_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_zhushi_tudoufen_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_juntang_zhushi_tudoufen_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img21.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_zhushi_shanggudunmian">上古炖面</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_zhushi_shanggudunmian_less"
						class="huoguo_zhushi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_zhushi_shanggudunmian_no"
						class="huoguo_zhushi_sub">0</span>
					<button id="huoguo_danren_juntang_zhushi_shanggudunmian_add"
						class="huoguo_zhushi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		<h2>
			小料<span> 可选 <b id="huoguo_danren_juntang_xiaoliao_no">0</b> 份
			</span>
		</h2>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img9.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_xiaoliao_xiangyou">香油</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_xiaoliao_xiangyou_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_xiaoliao_xiangyou_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_juntang_xiaoliao_xiangyou_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img10.jpg"
				alt="">
				<h3 id="huoguo_danren_juntang_xiaoliao_majiang">麻酱</h3>

				<div class="number">
					<button id="huoguo_danren_juntang_xiaoliao_majiang_less"
						class="huoguo_xiaoliao_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="huoguo_danren_juntang_xiaoliao_majiang_no"
						class="huoguo_xiaoliao_sub">0</span>
					<button id="huoguo_danren_juntang_xiaoliao_majiang_add"
						class="huoguo_xiaoliao_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		</article>
		<article>
		<h1>加肉</h1>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img22.jpg"
				alt="">
				<h3 id="rou_feiniu">肥牛</h3>
				<h4>
					<span id="rou_feiniu_price">28</span> ¥
				</h4>
				<div class="number">
					<button id="rou_feiniu_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="rou_feiniu_no">0</span>
					<button id="rou_feiniu_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img23.jpg"
				alt="">
				<h3 id="rou_feiyang">肥羊</h3>
				<h4>
					<span id="rou_feiyang_price">28</span> ¥
				</h4>
				<div class="number">
					<button id="rou_feiyang_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="rou_feiyang_no">0</span>
					<button id="rou_feiyang_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>


			<li><img class="img" src="${ctx}/static/resource/img/img4.jpg"
				alt="">
				<h3 id="rou_huiyupian">鮰鱼片</h3>
				<h4>
					<span id="rou_huiyupian_price">28</span> ¥
				</h4>
				<div class="number">
					<button id="rou_huiyupian_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="rou_huiyupian_no">0</span>
					<button id="rou_huiyupian_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img5.jpg"
				alt="">
				<h3 id="rou_daxia">大虾</h3>
				<h4>
					<span id="rou_daxia_price">28</span> ¥
				</h4>
				<div class="number">
					<button id="rou_daxia_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="rou_daxia_no">0</span>
					<button id="rou_daxia_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img24.jpg"
				alt="">
				<h3 id="rou_wucanrou">午餐肉</h3>
				<h4>
					<span id="rou_wucanrou_price">28</span> ¥
				</h4>
				<div class="number">
					<button id="rou_wucanrou_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="rou_wucanrou_no">0</span>
					<button id="rou_wucanrou_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
		</ul>
		</article>
		<article>
		<h1>饮料 最多10份</h1>
		<ul>
			<li><img class="img" src="${ctx}/static/resource/img/img51.jpg"
				alt="">
				<h3 id="yinliao_xuebi">雪碧</h3>
				<h4>
					<span id="yinliao_xuebi_price">4</span> ¥
				</h4>
				<div class="number">
					<button id="yinliao_xuebi_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="yinliao_xuebi_no">0</span>
					<button id="yinliao_xuebi_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img52.jpg"
				alt="">
				<h3 id="yinliao_kele">可乐</h3>
				<h4>
					<span id="yinliao_kele_price">4</span> ¥
				</h4>
				<div class="number">
					<button id="yinliao_kele_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="yinliao_kele_no">0</span>
					<button id="yinliao_kele_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img53.jpg"
				alt="">
				<h3 id="yinliao_pijiu">啤酒</h3>
				<h4>
					<span id="yinliao_pijiu_price">4</span> ¥
				</h4>
				<div class="number">
					<button id="yinliao_pijiu_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="yinliao_pijiu_no">0</span>
					<button id="yinliao_pijiu_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>
			<li><img class="img" src="${ctx}/static/resource/img/img55.jpg"
				alt="">
				<h3 id="yinliao_shui">矿泉水</h3>
				<h4>
					<span id="yinliao_shui_price">2</span> ¥
				</h4>
				<div class="number">
					<button id="yinliao_shui_less">
						<img src="${ctx}/static/resource/img/less.svg" alt="">
					</button>
					<span id="yinliao_shui_no">0</span>
					<button id="yinliao_shui_add">
						<img src="${ctx}/static/resource/img/add.svg" alt="">
					</button>
				</div></li>

		</ul>
		</article>
		<footer>
		<div>
			<h1>
				<img src="${ctx}/static/resource/img/shape.svg" type=""> <span
					id="totalno">0</span>
			</h1>
			<h5>
				共 <span>¥ <b id="totalprice">0</b></span>
			</h5>
		</div>
		<button id="submitbtn">选好了</button>
		<form id="submitform" method="post" action="${ctx}/qt/ordercreate.do">
		<input type="hidden" id="openid" name="openid"  value="${openid}">
			<input type="hidden" id="fdishlist" name="fdishlist" value="">
		</form>
		</footer>
	</div>

</body>
</html>